//
//  ShoppingCarModel.swift
//  koolcar
//
//  Created by kuaimaxiansheng on 2022/8/6.
//

import UIKit
import ObjectMapper
class ShoppingCarModel: Mappable {
    var code: String?
    var msg: String?
    var data: [ShoppingCarListModel]?
    
    func mapping(map: Map) {
        code <- map["code"]
        msg <- map["msg"]
        data <- map["data"]
    }
    required init?(map: Map) {
        
    }
}

class ShoppingCarListModel: Mappable {
    var id: Int?
    var quantity: Int?
    var skuId: Int?
    var productName: String?
    var isShelf: Int?//0 下架 1 上架
    var stock: Int?//库存
    var availableStock: Int?//可用库存为0 则售空
    var params: String?
    var productImages: String?
    var price: Double?//单价
    var isSelect: Bool = false
    var productId: Int?
    var isLimitedTime: Int?//限时抢购:1
    var activityTime: NSInteger? //限时抢购时间
    var isValid: Bool?
    var promotionEnd: String?
    var discountType: NSInteger? //折扣类型
    
    var delFlag: Int?
    var memberDiscount: Int?
    var name: String?//商品名称
    var orderPrice: Double?
    var unitPrice: Double?
    var parameterSnapshot: String?//参数信息
    
    //======
    var modifyBlock: ((NSInteger)->Void)?
    var selectBlock: (()->Void)?
    func mapping(map: Map) {
        discountType <- map["discountType"]
        promotionEnd <- map["promotionEnd"]
        id <- map["id"]
        quantity <- map["quantity"]
        skuId <- map["skuId"]
        productName <- map["productName"]
        isShelf <- map["isShelf"]
        stock <- map["stock"]
        availableStock <- map["availableStock"]
        params <- map["params"]
        productImages <- map["productImages"]
        price <- map["price"]
        productId <- map["productId"]
        
        delFlag <- map["delFlag"]
        memberDiscount <- map["memberDiscount"]
        name <- map["name"]
        orderPrice <- map["orderPrice"]
        unitPrice <- map["unitPrice"]
        parameterSnapshot <- map["parameterSnapshot"]
        parameterSnapshot <- map["params"]
        productImages <- map["productImage"]
        isLimitedTime <- map["isLimitedTime"]
        activityTime <- map["activityTime"]
        isValid <- map["isValid"]
  
        
    }
    
    required init?(map: Map) {
        
    }
}
